Skip to main content

Table validations button

Table Validations Button

The Validations button is found in the Table's Properties Advanced tab. When clicked, it opens a new window to create the table validations.

In the Table Validations window, you can evaluate several conditions to ensure the data input and structure of the Table are correct.

FormsComponents94

Counters

Counters are variables used to obtain the number of rows that meet specific conditions. These counters are defined in the first section of the table validations window.

For example, in a table containing product quotations:

  • The first Counter assigns the total number of rows in the Table to the NewCounter variable.
  • The second Counter sets the variable NewCounter2 to the number of rows that meet a join condition, such as if the Total price for a product is less than its Unit price.
  • The last Counter, stored in NewCounter3, evaluates each record where the Unit price is less than 1,000.

ControlsProperties11

You can also create multiple conditions by using AND/OR operators. For example, the following counter evaluates records where the total price is less than the unit price OR the total price is greater than 50,000.

ControlsProperties22

Additionally, you can create groups of conditions by linking them using the Link option. In the example below, the counter evaluates records where the total price is less than the unit price OR those whose total price is between 50,000 and 100,000.

ControlsProperties23

Note: Conditions defined for counters are evaluated over all existing records in the table. If you perform table validations on filtered tables, you should include the filter conditions when defining counters.

Validations

In the lower section of the window (Validations), we define the validations to be performed. As mentioned earlier, these validations can be defined either directly over attributes or using the counters defined in the top section.

When defined over attributes, validations will evaluate the entire column related to the attribute and will display an error message if any record fails to meet the condition.

Note: Direct validations apply to the whole column and should not be used when you need to evaluate a condition involving more than one column. In such cases, use counters.

Validations can also evaluate multiple conditions and groups, similar to counters.

The image below shows a table validation consisting of four conditions: the first three evaluate counters, and the last one evaluates an attribute directly.

ControlsProperties21

Since all four validations are defined with an OR condition, only one condition needs to be true for an error message to display.

You can also create multiple independent validations by clicking Show multiple validations at the bottom left. This will display a New button to create a new validation. Each validation can be accessed through the drop-down list at the top right of the window, with the first validation shown by default.

ControlsProperties12

Example

In a Purchase Request Process, the Products Requested Table must comply with the following conditions:

  • Contain at least one record.
  • For all records, the Unit price must be less than the Total price (since Total price = Unit price x Quantity).
  • For all records, the Unit price must be less than 1,000, and the Total price must be less than 20,000.

We will create three independent validations, one for each condition.

Example Using Counters

The first example uses a row counter. It evaluates how many rows are present in the table and returns an error message if there are fewer than one (i.e., no rows).

ControlsProperties13 ControlsProperties14

Example with Direct Validations

The second example uses a direct validation. Bizagi will evaluate if any records have the Unit price greater than the Total price. If such a record is found, an error message will display.

ControlsProperties15 ControlsProperties16

Example Using Composed Counters

The third validation uses a row counter to evaluate two conditions. It will count how many rows meet these conditions and return an error message if at least one does.

ControlsProperties25 ControlsProperties26